'use strict'
// Template version: 1.3.1
// see http://vuejs-templates.github.io/webpack for documentation.

const path = require('path')
const devEnv = require("./dev.env");
module.exports = {
    dev: {
        // Paths
        assetsSubDirectory: 'static',
        assetsPublicPath: '/',
        proxyTable: devEnv.OPEN_PROXY === false ? {} : {
            "/proxyApi": {
                // target: 'http://192.168.60.185:8232',
                // target: 'http://192.168.60.164:8232',
                target: 'http://zhibotest.yl1001.com', //正式://zhibo.yl1001.com/webservice/live_video/index.jsp/v1/sys
                // target: 'http://zhibo.yl1001.com',
                changeOrigin: true,
                timeout: 360000,
                pathRewrite: {
                    "^/proxyApi": ""
                }
            },
            "/proxyPhp": {
                // target: "http://192.168.60.70/m5.yl1001.com/server",//黄玲
                // target: "http://192.168.60.172/m5.yl1001.com/server", //许礼鸿
                target: "https://m5test.yl1001.com", 
                // target: "https://m5.yl1001.com", 
                changeOrigin: true,
                timeout: 360000,
                pathRewrite: {
                    "^/proxyPhp": ""
                }
            },
            "/proxyXlh": {//http://192.168.60.172/m5.yl1001.com/server/controller/v1/public/index.php/luckdraw/index/getLuckdrawSubject?cj_id=5081614069786353
                target: "http://192.168.60.172/m5.yl1001.com/server",
                // target: "https://m5test.yl1001.com", 
                // target: "https://m5.yl1001.com", 
                changeOrigin: true,
                timeout: 360000,
                pathRewrite: {
                    "^/proxyXlh": ""
                }
            },
            "/proxyHtyLocal": {
                target: 'http://m.yewen1001.com',
                // target: 'http://192.168.60.177:8080',
                changeOrigin: true,
                timeout: 360000,
                pathRewrite: {
                    "^/proxyHtyLocal": ""
                }
            },
            "/weixin": {
                target: "http://m5.yl1001.com",
                changeOrigin: true,
                timeout: 360000,
                pathRewrite: {
                    "^/weixin": ""
                }
            },
            "/proxyHty": {
                target: "http://sz.yewen1001.com",
                changeOrigin: true,
                timeout: 360000,
                pathRewrite: {
                    "^/proxyHty": ""
                }
            },
            
        },

        // Various Dev Server settings
        // host: 'localhost', // localhost can be overwritten by process.env.HOST
        host: "127.0.0.1",
        port: 8080, // can be overwritten by process.env.PORT, if port is in use, a free one will be determined
        autoOpenBrowser: true,
        errorOverlay: true,
        notifyOnErrors: true,
        poll: false, // https://webpack.js.org/configuration/dev-server/#devserver-watchoptions-


        /**
         * Source Maps
         */

        // https://webpack.js.org/configuration/devtool/#development
        //1. source-map增加一个映射文件, 2. eval-source-map,不会产生文件可以看到映射文件, 3.cheap-module-source-map//出现文件但是不会提示显示
        devtool: 'cheap-module-eval-source-map',

        // If you have problems debugging vue-files in devtools,
        // set this to false - it *may* help
        // https://vue-loader.vuejs.org/en/options.html#cachebusting
        cacheBusting: true,

        cssSourceMap: false
    },

    build: {
        // Template for index.html
        index: path.resolve(__dirname, '../dist/index.html'),

        // Paths
        assetsRoot: path.resolve(__dirname, '../dist'),
        assetsSubDirectory: 'static',
        assetsPublicPath: './',

        /**
         * Source Maps
         */

        productionSourceMap: false,
        // https://webpack.js.org/configuration/devtool/#production
        devtool: '#source-map',

        // Gzip off by default as many popular static hosts such as
        // Surge or Netlify already gzip all static assets for you.
        // Before setting to `true`, make sure to:
        // npm install --save-dev compression-webpack-plugin
        productionGzip: false,
        productionGzipExtensions: ['js', 'css'],

        // Run the build command with an extra argument to
        // View the bundle analyzer report after build finishes:
        // `npm run build --report`
        // Set to `true` or `false` to always turn it on or off
        bundleAnalyzerReport: process.env.npm_config_report
    }
}